#include <vector>
#include <string>
#include <fstream>

#include "long_int_t.h"

int main()
{
   std::ifstream input("in.txt");
   std::ofstream output("out.txt");

   long_int_t a, b;
   while (input >> a >> b)
   {
      if (b != long_int_t::zero())
      {
         std::pair<long_int_t, long_int_t> result = a.quotient_and_remainder(b);
         output << result.first << "\n" << result.second << "\n\n";
      }
      else
      {
         output << "<error>\n\n\n";
      }
   }

   return 0;
}